package com.neu.dao;


import com.neu.entity.Apply;
import com.neu.entity.Hire;
import com.neu.entity.Params;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface ApplyDao extends Mapper<Apply>{
    //List<Hire> findBySearch(@Param("params") Params params);
    List<Apply> findBySearch(@Param("params") Params params);

    @Update("update hire set pay = 'Paid' where id = #{id}")
    void updatePay(Apply hire);

    @Update("update hire set content = concat(IFNULL(content, ''), #{content}) where id = #{id}")
    void updateContentById(Apply hire);

    List<Apply> findByAll(@Param("params") Params params);

//    @Select("select a.* from admin a join hire h on a.id = h.tutorId where h.id = #{id}")
//    Admin getTutorInformation(Hire hire);

//    @Update("update admin set content = #{content} where id = #{tutorId}")
//    void updateAdminContent(Hire hire);
}
